package iotest.practice02;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class CopyDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("gouzi.jpg");
        FileOutputStream fos = new FileOutputStream("dagou.jpg");

        int i;
        long start = System.currentTimeMillis();
        while ((i = fis.read()) != -1)
        {
            fos.write(i);
        }
        long end = System.currentTimeMillis();
        System.out.println("复制完毕" + (end - start));

        fis.close();
        fos.close();
    }
}
